<?php

namespace App\Http\Controllers;

use App\Library\Logic\SqlErrorLogic;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Application;

class SqlErrorController extends Controller
{

    public function index(string $serialNumber): Factory|Application|View|\Illuminate\Contracts\Foundation\Application
    {
        if (strlen($serialNumber) === 20) $item = SqlErrorLogic::findBySerialNumber($serialNumber);
        else $item = SqlErrorLogic::detail((int)$serialNumber);
        return view('sqlError.index', ['data' => $item]);
    }
}
